<template>
	<view style="background:#f2f5fa;overflow: hidden;">
		
			<view class="saishiContent-wrap">
				<u--image :src="matchContent.matchImg"  width="630rpx" height="393.75rpx" />
				<u--text :text="matchContent.matchTitle" margin="20rpx 0 10rpx 5rpx"/>
			</view>
			<view class="formVosWrap">
				<view class="forms-item" v-for="(item,index) in matchInput" :key="index"
				:style="{marginTop:index==0?'0px':'20rpx'}" @click="goPage('/subpkg/saishibaoming/saishibaoming',{matchId:item.matchId,formId:item.formId})"
				>
				
					<view class="forms-item-title">
						<u--text :text="item.formName" margin="20rpx 0 10rpx 5rpx" lines="1" />
						<!-- payType: "normal" -->
						<u-tag :text="item.formType=='normal_from'?'普通报名':
						item.formType=='member_form'?'会员报名':
						item.formType=='team_form'?'团队报名':''
						" :type="
						item.formType=='normal_from'?'primary':
						item.formType=='member_form'?'error':
						item.formType=='team_form'?'warning':''
						" plain plainFill/>
						
					</view> 
				</view>
			</view>
		
		
			
		
	</view>
</template>

<script>
	import {mapActions} from 'vuex'
	export default {
		data() {
			return {
				matchContent:{},
				matchInput:[]
			}
		},
		onLoad(params) {
			
			//赛事详情
				this.getSaishiContentAction({matchId:params.matchId,success:res=>{
					this.matchContent={...res.data.data}
					console.log(this.matchContent)
				}})
				//赛事表单详情
				this.getSaishiIngInputAction({matchId:params.matchId,success:res=>{
					console.log(res)
					if(res.data.data){
						this.matchInput=[...res.data.data]
					}
				}})
		},
		methods: {
			...mapActions('m_saishi',['getSaishiContentAction','getSaishiIngInputAction']),
			//路由跳转
			goPage(url,obj){
				if(this.$store.state.m_login.token.length==0) return  uni.$u.toast('请您先登录')
				uni.$u.route(url,obj);
			},
		}
	}
</script>

<style lang="scss" scoped>
.saishiContent-wrap{padding:30rpx;background: #fff;border-radius: 11px;margin: 30rpx;overflow: hidden;
		image{border-top-right-radius: 11px;border-top-left-radius: 11px;}
		}
.formVosWrap{overflow: hidden;
	.forms-item{background: #fff;padding:20rpx;margin: 30rpx;
		.forms-item-title{display: flex;justify-content: space-between;align-items: center;}
	}
}	
	

</style>
